<div class="page-4 commonPage">
	<div class="bg-3"></div>
	<?php echo $this->element('sidebar') ?>
	<div class="box-right zhigh">
        <?php echo $this->element('banner'); ?>
			<div class="title">
                <ul class="breadcrumbs">
                    <li><a href="<?php echo $this->General->base_url() ?>"><img style="position: relative; top: 2px;" src="<?php echo $this->webroot ?>images/home-yl-2.png" /></a></li>
                    <?php
                        foreach($breadcrumbs as $breadcrumb)
                        {
                            echo '<li><a href="'.$this->General->base_url().$breadcrumb['link'].'">'.$breadcrumb['title'].'</a></li>';
                        }
                    ?>
                </ul>
			</div>
        <?php echo $this->element('header') ?>
		<div class="box-detail">
			<div class="detail-top">
				<div class="big-image">
					<div class="main-image main-image-cutkit">
                    <?php
                        foreach($images as $value)
                        {
                            $image = $this->webroot . $value['Image']['name'];
                            $image_thumb = $this->webroot . str_replace('upload/images/', 'upload/_thumbs/images/', $value['Image']['name']);
                    ?>
                            <a href="<?php echo $image ?>" rel="<?php echo $image ?>" class="zoomple"><img src="<?php echo $image ?>"/> </a>
                    <?php
                        break;
                        }
                    ?>
						
					</div>
					<ul class="sub-images">
                        <?php
                            $i = 0;
                            foreach($images as $value)
                            {
                                if($i++ == 5)
                                    break;
                                $image = $this->webroot . $value['Image']['name'];
                                $image_thumb = $this->webroot . str_replace('upload/images/', 'upload/_thumbs/images/', $value['Image']['name']);
                        ?>
						<li><a href="#"><img rel="<?php echo $image ?>" src="<?php echo $image ?>"/></a></li>
                        <?php
                            
                            }
                        ?>
					</ul>
				</div>
				<div class="detail-text">
					<div class="bg">
						<h3><?php echo $product_info['product_desc']['title'] ?></h3>
						<h3><?php $this->General->translate('p_detail') ?></h3>
						<div class="col-detail">
                        <?php
                            foreach($product_compo as $compo)
                            {
                        ?>
							<div class="row">
								<span class="col1"><?php echo $compo['composition']['title'] ?></span>
								<span>: <?php echo $compo['product_compo']['content'] ?></span>
							</div>
                        <?php
                            }
                        ?>

							<div class="clear"></div>
						</div>
						<div class="status">
                            <?php
                                if($product_info['product']['discount']!='' && $product_info['product']['discount']!=0)
                                {
                            ?>
                                <div class="price"><?php $this->General->translate('price') ?>: <span style="text-decoration: line-through;"><?php echo ($product_info['product']['price']!='' && $product_info['product']['price']!=0) ? number_format($product_info['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?></span> <br/> 
                                <span style="float: left;"><?php $this->General->translate('price_down') ?>: </span><span class="price-sale"> <?php echo ($product_info['product']['discount']!='' && $product_info['product']['discount']!=0) ? number_format($product_info['product']['discount'],0,',','.') .' '. $settings['currency'] : '' ?></span>
                                <span class="percent-sale"><?php echo ($product_info['product']['percent_discount'] == '' || $product_info['product']['percent_discount'] == 0) ? '' : '-'.$product_info['product']['percent_discount'].'%' ?></span></div> 
                            <?php
                                }
                                else
                                {
                            ?>
                                <span style="float: left;" ><?php $this->General->translate('price') ?>: </span><span style="float: left;" class="price-sale"> <?php echo ($product_info['product']['price']!='' && $product_info['product']['price']!=0) ? number_format($product_info['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?></span>
                            <?php
                                }
                            ?>
							<div class="st"><?php $this->General->translate('p_status') ?>: <?php echo $product_info['product']['in_stock'] != 1 ? $this->General->get_translate('out_stock') : $this->General->get_translate('in_stock') ?></div>
						</div>
						<div class="buynow">
							<a href="javascript:void(0)" order="order" product_id="<?php echo $product_info['product']['product_id'] ?>" class="bn"><?php $this->General->translate('buy_now') ?></a>
							<a href="javascript:void(0)" favorite="favorite" product_id="<?php echo $product_info['product']['product_id'] ?>" class="favorite">
                                <?php $this->General->translate('save_favorite') ?>
                                <?php
                                    if(isset($favorite[$product_info['product']['product_id']]))
                                        echo '<span><img width="12" src="'. $this->webroot .'images/check.png" /></span>';
                                ?>
                                
                            </a>
						</div>
						<div class="mailing">
							<ul>
                            <?php
                                foreach($menu_ct_san_pham as $menu_ct)
                                {
                                    if($menu_ct['menu']['other'] == 'mail')
                                    {
                                        $l = $this->General->base_url() . $link_product;
                                        $href = $this->General->base_url() .'sendmail?u='. base64_encode($l);
                                        $target = "target='_blank'";
                                    }
                                    else
                                    {
                                        $href = $this->General->base_url() . $menu_ct['menu_desc']['link'];
                                        $target = '';
                                    }
                                    
                                    echo '<li><a '. $target .' href="'. $href .'" class="'.$menu_ct['menu']['other'].'">'.$menu_ct['menu_desc']['title'].'</a></li>';
                                }
                            ?>
							</ul>
						</div>
						<div class="clear"></div>
					</div>
					<div class="social-link">
                        <!-- Go to www.addthis.com/dashboard to customize your tools -->
                        <div class="addthis_native_toolbox"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<div class="promise">
				<h3><?php $this->General->translate('cam_ket') ?></h3>
				<ul>
					<li class="return">
						<span><?php echo @$cate_info_cutkit_camket['category_desc']['meta_title'] ?></span>
					</li>
					<li class="shipall">
						<span><?php echo @$cate_info_cutkit_camket['category_desc']['meta_description'] ?></span>
					</li>
					<li class="sure">
						<span><?php echo @$cate_info_cutkit_camket['category_desc']['meta_keywords'] ?></span>
					</li>
				</ul>
			</div>
			<div class="more-detail">
				<div class="tabdetail">
					<div class="title">
						<ul>
							<li class="active"><a href="#detail"><?php $this->General->translate('product_detail') ?></a></li>
							<li><a href="#info"><?php $this->General->translate('product_info') ?></a></li>
							<li><a href="#comment"><?php $this->General->translate('comment_clients') ?></a></li>
							<li><a href="#skill"><?php $this->General->translate('phat_trien_ky_nang') ?></a></li>
						</ul>
					</div>
				</div>
				<div class="tabcontent">
					<div class="tab active" id="detail">
						<table border="1" width="100%">
                            <?php
                                foreach($product_compo as $compo)
                                {
                            ?>
                                <tr>
                                    <td width="40%"><?php echo $compo['composition']['title'] ?></td>
                                    <td><?php echo $compo['product_compo']['content'] ?></td>
                                </tr>
                            <?php
                                }
                            ?>
                        </table>
                        
					</div>
                    <div class="tab" id="info"><?php echo $product_info['product_desc']['description'] ?></div>
                    <div class="tab" id="comment">
                        <div class="comments">
            				<div class="fb-comments" data-href="<?php echo $this->General->base_url() . $link_product ?>" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
                        </div>
                    </div>
                    <div class="tab" id="skill">
                        <?php echo $product_info['product_desc']['long_description'] ?>
                    </div>
				</div>
			</div>
			<div class="vote-detail">
				<div class="txt"><?php $this->General->translate('voite_product') ?>: <?php $this->General->translate('voite_start') ?></div>
				<div class="vote-box">
					<div class="votebox-1 vt">
						<input id="rating-1" type="number" product_id="<?php echo $product_info['product']['product_id'] ?>" class="rating-detail" data-show-caption="false" value="<?php echo $product_info['product']['rating'] ?>" />
					</div>
                    <?php
                        if($product_info['product']['count_rating'] != '' && $product_info['product']['count_rating'] > 0)
                            echo '<span style="position: relative; top: 5px; left: -5px;" class="count_rating">('.$product_info['product']['count_rating'].' '.$this->General->get_translate('luot_danh_gia').'.)</span>';
                    ?>
				</div>
			</div>
		</div>
		<div class="clear"></div>
            <div class="product-favorites cutkit-favorites">
                <div class="head-p-favorites">
                    <?php $this->General->translate('product_favorite') ?>              
                </div>
                <div class="content-p-favorites">
                    <div class="content-slider-bottom" id="uneven_slider">
                    	<div class="uneven">
	                        <?php
                                foreach($products_favorite as $product)
                                {
                                    $link = $this->General->base_url() . 'danh-muc-san-pham/' . $product['product']['product_id'] .'-'. $product['link']['link'] .'.html';
                            ?>
                            <div class="slick-slide">
	                            <a class="actn" href="<?php echo $link ?>">
	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
	    						</a>
								<div class="box-price">
									<div class="shadow-price">
										<div class="name">
											<a href="<?php echo $link ?>" class="s-1"><?php echo $product['product_desc']['title'] ?></a>
											<span class="s-2">
												<?php
                                                    if($product['product']['discount']!='' && $product['product']['discount']!=0)
                                                    {
                                                ?>
                									<span class="b">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                                                    </span>
                									<span class="real">
                                                        <?php echo ($product['product']['discount']!='' && $product['product']['discount']!=0) ? number_format($product['product']['discount'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                    else
                                                    {
                                                ?>
                                                    <span class="real">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                ?>
											</span>
										</div>
										<div class="buy"><a order="order" product_id="<?php echo $product['product']['product_id'] ?>" href="javascript:void(0)"><?php $this->General->translate('buy') ?></a></div>
									</div>
									
								</div>
	                        </div>
                            <div class="slick-slide">
	                            <a class="actn" href="<?php echo $link ?>">
	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
	    						</a>
								<div class="box-price">
									<div class="shadow-price">
										<div class="name">
											<a href="<?php echo $link ?>" class="s-1"><?php echo $product['product_desc']['title'] ?></a>
											<span class="s-2">
												<?php
                                                    if($product['product']['discount']!='' && $product['product']['discount']!=0)
                                                    {
                                                ?>
                									<span class="b">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                                                    </span>
                									<span class="real">
                                                        <?php echo ($product['product']['discount']!='' && $product['product']['discount']!=0) ? number_format($product['product']['discount'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                    else
                                                    {
                                                ?>
                                                    <span class="real">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                ?>
											</span>
										</div>
										<div class="buy"><a order="order" product_id="<?php echo $product['product']['product_id'] ?>" href="javascript:void(0)"><?php $this->General->translate('buy') ?></a></div>
									</div>
									
								</div>
	                        </div>
                            
	                        <?php
                                }
                             ?>
	                    </div>
                    </div>
                </div>
            </div>
		
	</div>
	<?php echo $this->element('footer') ?>
</div>